package com.alquiler.utils;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.control.TableCell;

public class ButtonCell<E, I> extends TableCell<E, I> {
	
	
        private static Button cellButton;
         
        public  ButtonCell(String nameButton, EventHandler<ActionEvent> event){
        	
        	this.cellButton = new Button(nameButton);             
            cellButton.setOnAction(event);
        }
 
        //Display button if the row is not empty
        @Override
        protected void updateItem(I t, boolean empty) {
            super.updateItem(t, empty);
            if(!empty){
                setGraphic(cellButton);
            }
        }  

}
